/*
 * ModelPool.h
 *
 *  Created on: 21.10.2012
 *      Author: Martin
 *
 *      loading data from obj files
 *      loading normals, polygons and other stuff
 *      stores model name and data
 */

#pragma once

#include "Model.h"

#ifdef _WIN32 
#include <windows.h> 
#endif

#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include "GL/gl.h"
#include "../TexPool.h"
#include "../console/globalConsole.h"
#include <glm/glm.hpp>

class ModelPool
{
public:
	// constructor
	// setup directory with models
	ModelPool();
	virtual ~ModelPool();

	// without .obj only name !!!
	int loadModel(std::string filename, std::string exfile);

	// return model ID in vector files
	int getModelByName(std::string filename);

	// return cout of models in memory
	int getCount();

	std::vector<Model*> getModels();

	// draw model
	// input - filename of model without .obj
	void drawModel(std::string filename);

	// draw model by ID
	// input ID of model in opengl memory
	void drawModelByID(GLuint id);

	// draw bounding box of model (ID)
	void drawBBoxByModelID(GLuint id, glm::vec3 pos, float angle);

private:
	// vector of models
	std::vector<Model*> files;

};

